<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="https://cdn.bootcss.com/babel-polyfill/7.0.0-alpha.12/polyfill.js"></script>
		<link href="css/main.css?v=d4c89955dc8ad6705982" rel="stylesheet">
		<link href="css/userManager.css" rel="stylesheet" />
		<link rel="stylesheet" href="css/swiper.min.css" />
		<link rel="stylesheet" href="css/video-js.min.css" />
		<link rel="stylesheet" href="css/newbase.css" />
		<link rel="stylesheet" href="css/newstyle.css" />
		<link rel="stylesheet" href="css/neworder.css" />
		<link rel="stylesheet" href="css/iconfont.css" />
		<link rel="stylesheet" href="js/newlayer/skin/layer.css" id="layui_layer_skinlayercss">
		<link href="js/My97DatePicker/skin/WdatePicker.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="js/swiper.jquery.min.js"></script>
		<script type="text/javascript" src="js/newlayer/layer.js"></script>
		<script type="text/javascript" src="js/icheck.min.js"></script>
		<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=0tqnGcviGS2hQWUWG7p6kI4A43M8tnF9&s=1"></script>
		<script type="text/javascript" src="https://api.map.baidu.com/library/CurveLine/1.5/src/CurveLine.min.js"></script>
		<script type="text/javascript" src="js/jquery.placeholder.min.js"></script>
		<link rel="stylesheet" href="js/select/skin/selectordie.css" />
		<link rel="stylesheet" href="js/select/skin/selectordie_theme_05.css" />
		<script type="text/javascript" src="js/select/selectordie.min.js"></script>
		<script type="text/javascript" src="js/newbase.js"></script>
		<script type="text/javascript" src="js/newLib.js"></script>
	</head>

	<body style="height: 100%;">
		<div class="navigation animated">
			<script type="text/javascript" src="https://api.map.baidu.com/api?ak=dZjnRr2t8nBpGswyCB731AFD&v=2.0&s=1"></script>
			<div id="allmap" style="display:none;"></div>
			<div class="nav-wrap">
				<h1 class="logo">
            	<a href="javascript:;"><img src="images/UU-logo.png" alt="uu-logo" height="75px"></a>
        		</h1>
				<div class="nav">
					<ul class="nav-list clearfix">
						<li>
							<a href="index.html" title="首页">首页</a>
						</li>
						<li class="active">
							<a href="#" title="订单大厅">订单大厅</a>
						</li>
						<li>
							<a href="buy.html" title="在线下单">在线下单</a>
						</li>
						<li>
							<a href="myOrder.html" title="我的订单">我的订单</a>
						</li>
					</ul>
					<div style="clear:both;"></div>
				</div>
				<div class="button-group">
					<ul class="button-list welcome" id="userinfo">
						<li>
							<a href="login.html" class="port fl"><img src="images/port.png" width="22" height="22" style="margin-right: 10px;" />登录</a>
						</li>
						<li style="display: none;">
							<p class="username fl">欢迎您，<span id="userMobile"></span>
							</p>
							<a class="loginout" href="javascript:order.loginOut()">退出</a>
						</li>
					</ul>
				</div>
			</div>
		</div>

		<div class="index" style="margin-top: 10px;height: 100%;">
			<div class="contentBox" style="height: 100%;">
				<div class="container clear" style="height: 100%;">
					<div id="ucard_order" class="fl " style="width: 1010px; margin-left: 20px; min-height: 810px; margin-top: 30px; display: block;">
						<div id="one " class="orderHistory Router ">
							<div class="box-shadow uu-title" style="height: 70px;line-height: 70px;">
								<span>订单标题:<span><input id="title" type="text" placeholder="请输入你要搜索的订单标题" style="font-size: 12px;width: 250px;"></span></span>
								<span style="margin-left: 20px;">商品类别：<span><select id="goodsType" style="width: 150px; font-size: 12px;color: darkgray;">
									<option value="" selected="selected">不限</option>
									<option value="2">文件</option>
									<option value="3">蛋糕</option>
									<option value="4">鲜花</option>
									<option value="5">钥匙</option>
									<option value="6">手机</option>
									<option value="7">快递</option>
									<option value="8">美食</option>
									<option value="9">香烟</option>
									<option value="10">酒</option>
									<option value="11">饮料</option>
									<option value="12">早餐</option>
									<option value="13">夜宵</option>
									<option value="14">药品</option>
									<option value="15">水果</option>
									<option value="16">生鲜</option>
									<option value="1">其他</option>
								</select></span></span>
								<span style="margin-left: 20px;">价格区间：<select id="price"  style="font-size: 12px;width: 100px;color: darkgray;">
									<option value="0">不限</option>
									<option value="1">0-49</option>
									<option value="2">50-200</option>
									<option value="3">200以上</option>
								</select></span>
								<span style="margin-left: 20px;">
									<button type="button" class="el-button el-button--primary">
										<span id="search" style="color: white;">查询</span></button>
								</span>
							</div>
							
							<div id="order_type" class="orderType clear box-shadow ">
								<span class="fl on" name="" style="width: 130px;text-align: center;">全部</span>
								<span class="fl " name="1" style="width: 130px;text-align: center;">帮我买</span>
								<span class="fl " name="2" style="width: 130px;text-align: center;">帮我送</span>
								<span class="fl " name="3" style="width: 130px;text-align: center;">帮我取</span>
								<span class="fl " name="4" style="width: 130px;text-align: center;">其他服务</span>
							</div>

							<div id="order-List" class="loading " style="position: relative; ">
								<ul class="orderList">
									<li class="box-shadow popUp">
										<div class="clear orderHeader">
											<div class="fl clear left "> <span class="orderId fl ">U0471600180422013329484076    </span></div>
											<div class="right fr">待接单
											</div>
										</div>
										<table cellspacing="0" cellpadding="0" width="100%" class="clear orderInfo" style="margin-left: 20px;margin-right: 20px;width: auto;">
											<tbody>
												<tr>
													<td class="clear firstInfo">
														<div class="orderInfo-item first  width">
															<div class="receiveInfo sendInfo">[发货]<span class="mobile">13558550380 </span><span class="address">成都市温江区柳台大道东段</span></div>
															<div class="sendInfo clear">[接单员性别]<span class="address">13538422201</span></div>
														</div>
													</td>
													<td class="disMon orderInfo-item firstInfo">

														<div>备注：17.00元</div>
													</td>
													<td class="disMon orderInfo-item firstInfo">
														
														<div>金额：17.00元</div>
													</td>
													<td class="cancelOrder" style="padding-right: 20px;"><span >立即接单</span></td>
												</tr>
											</tbody>
										</table>
										<div class="passOrder" style="display: none;"></div>
										<p class="time">发单时间：2018-04-22 01:33</p>
									</li>
								</ul>
								<div class="el-loading-mask" style="display: none;">
									<div class="el-loading-spinner">
										<svg viewBox="25 25 50 50" class="circular">
											<circle cx="50" cy="50" r="20" fill="none" class="path"></circle>
										</svg>
										<!---->
									</div>
								</div>
							</div>
							<div class="pagation box-shadow ">
								<div class="el-pagination el-pagination--small "><button type="button " class="btn-prev disabled "><i class="el-icon el-icon-arrow-left "></i></button>
									<ul class="el-pager ">
										<li class="number active ">1</li>
									</ul><button type="button " class="btn-next disabled "><i class="el-icon el-icon-arrow-right "></i></button></div>
							</div>
							
						</div>
					</div>
				</div>

			</div>
		</div>
	</body>
	<script>
        //订单类型选项点击事件
		var oType="";
        $("#order_type").children("span").click(function(){
            $("#order_type").children("span").removeClass("on");
            $(this).addClass("on");
           oType = $("#order_type").children("span[class='fl on']").attr("name");
            request(oType);
        });
        request("");
        function request(oType) {
            var title = $("#title").val();
            var goodsType = $("#goodsType").val();
            var price = $("#price").val();
            var minPrice="";
            var maxPrice="";
            if (price == 1){
                maxPrice = 50;
            }
            if (price ==2){
                minPrice = 50;
                maxPrice = 200;
            }
            if (price == 3){
                minPrice = 200
            }
            console.log("title:"+title);
            console.log("goodsType:"+goodsType);
            console.log("price:"+price);
            $.post("/order/get_orders/select",
                {"minPrice":minPrice,"maxPrice":maxPrice,"title":title,"goodsType":goodsType,"oType":oType},function (data) {
                    $("#order-List").empty();
                    for (var i=0;i<data.length;i++){
                        showdata(data[i]);
                    }
                })
        }

        $("#search").click(function () {
            request("");
        })

        function showdata(order) {
            var recvied = ""
            if (order.oType == 1){
                recvied ='\t\t\t\t\t\t\t\t\t\t\t\t\t<div class="receiveInfo sendInfo">[取货]<span name="sendPhone" class="mobile">'+order.sendPhone+' </span>\n' +
                    '\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span name="sendPepole">'+order.sendPepole+'</span>\n' +
                    '\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span name="sendAddress" class="address"><span>地址：</span>'+order.sendAddress+'</span></div>\n';
            }
            var html='<ul class="orderList">\n' +
                '\t\t\t\t\t\t\t\t<li class="box-shadow popUp">\n' +
                '\t\t\t\t\t\t\t\t\t<div class="clear orderHeader">\n' +
                '\t\t\t\t\t\t\t\t\t\t<div class="fl clear left ">\n' +
                '\t\t\t\t\t\t\t\t\t\t\t<span name="oId" class="orderId fl ">订单号：'+order.oId+'</span>\n' +
                '\t\t\t\t\t\t\t\t\t\t\t<span name="title" class="orderMark fl omit" style="text-align: center">'+order.title+'</span></div>\n' +
                '\t\t\t\t\t\t\t\t\t\t<div class="right fr">状态\n' +
                '\t\t\t\t\t\t\t\t\t\t\t<span name="oState">未接单</span></div>\n' +
                '\t\t\t\t\t\t\t\t\t</div>\n' +
                '\t\t\t\t\t\t\t\t\t<table cellspacing="0" cellpadding="0" width="100%" class="clear orderInfo">\n' +
                '\t\t\t\t\t\t\t\t\t\t<tr>\n' +
                '\t\t\t\t\t\t\t\t\t\t\t<td class="clear firstInfo">\n' +
                '\t\t\t\t\t\t\t\t\t\t\t\t<div class="orderInfo-item first  width" style="padding: 24px;">\n' + recvied +
                '\t\t\t\t\t\t\t\t\t\t\t\t\t<div class="sendInfo clear">[收货信息]<span name="receivedPhone" class="mobile">'+order.receivedPhone+'</span>\n' +
                '\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span name="receivedPepole">'+order.receivedPhone+'</span>\n' +
                '\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span name="receivedAddress" class="address "><span>地址：</span>'+order.receivedAddress+'</span></div>\n' +
                '\t\t\t\t\t\t\t\t\t\t\t\t\t<div class="sendInfo clear">[接单员性别]：<span name="corridorGender">'+order.corridorGender+'</span></div>\n' +
                '\t\t\t\t\t\t\t\t\t\t\t\t</div>\n' +
                '\t\t\t\t\t\t\t\t\t\t\t</td>\n' +
                '\t\t\t\t\t\t\t\t\t\t\t<td class="disMon orderInfo-item firstInfo">\n' +
                '\t\t\t\t\t\t\t\t\t\t\t\t<div><b>备注:</b><span name="remark">'+order.remark+'</span></div>\n' +
                '\t\t\t\t\t\t\t\t\t\t\t</td>\n' +
                '\t\t\t\t\t\t\t\t\t\t\t<td class="disMon orderInfo-item firstInfo">\n' +
                '\t\t\t\t\t\t\t\t\t\t\t\t<div>金额：<span name="price">'+order.price+'</span>元</div>\n' +
                '\t\t\t\t\t\t\t\t\t\t\t</td>\n' +
                '\t\t\t\t\t\t\t\t\t\t\t<td class="cancelOrder"><span oId="'+order.oId+'" onclick="take_order(this);">立即接单</span>\n' +
                '\t\t\t\t\t\t\t\t\t\t\t</td>\n' +
                '\t\t\t\t\t\t\t\t\t\t</tr>\n' +
                '\t\t\t\t\t\t\t\t\t</table>\n' +
                '\t\t\t\t\t\t\t\t\t<p  class="time">发单时间：<span name="oDate">'+order.oDate+'</span></p>\n' +
                '\t\t\t\t\t\t\t\t</li>\n' +
                '\t\t\t\t\t\t\t</ul>';
            $("#order-List").append(html);
        }

        function take_order(node) {
            var oId = node.getAttribute("oId");
            $.post("/reciving_order",{"oId":oId},function (data) {
				if (data.success){
				    alert("接单成功，请尽快完成订单");
                    request(oType);
				}else {
				    alert(data.msg);
				}
            });
        }
	</script>
</html>